/*
 * TipoAtendimento.java
 *
 * Created on October 12, 2007, 10:46 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package petstore.model;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * Entity class TipoAtendimento
 * 
 * @author Tom Hayden
 */
@Entity
@Table(name = "tipo_atendimento")
@AttributeOverrides( {
    @AttributeOverride(name="id", column=@Column(name="cdtipoatdmto")),
    @AttributeOverride(name="description", column=@Column(name="dstipoatdmto")),
    @AttributeOverride(name="active", column=@Column(name="ativo"))
})
@NamedQueries( {
    @NamedQuery(name="TipoAtendimento.findAll",
                query="SELECT bo " +
                      "FROM TipoAtendimento bo " +
                      "WHERE bo.active = true " +
                      "ORDER BY bo.description")
})
public class TipoAtendimento extends CodeData {
    
    public static final int VETERINARIO = 1;
    public static final int BANHO_TOSA = 2;

    /** Creates a new instance of TipoAtendimento */
    public TipoAtendimento() {
    }
    
    public TipoAtendimento(Integer id) {
        super(id);
    }
    
    public boolean isVeterinario() {
        return (this.id == VETERINARIO);
    }
    
    public boolean isBanhoTosa() {
        return (this.id == BANHO_TOSA);
        
    }

}
